A processor which executes an Operating System (OS) implemented for a computer re-allocates a memory region freed up after the execution of a prior process or task as a memory region of memory for use in executing a new process or task which will operate with the OS. Before executing the re-allocation of such a memory region, the memory region is reinitialized to prevent the leakage of the information about the prior process or task left in the memory region to be re-allocated. However, there may be a case in which the initialization is not desired in allocating memory in the kernel of the OS, or a case in which a freed up memory region is not used in executing a new process in a specified valid duration such as a period up to the turning off of a power supply of a computer even though the freed up memory region has been initialized. Then, to control undesired execution of initialization, the reinitialization of a memory region may be performed when the re-allocation of a memory region is requested.
In the OS operated by a processor, the memory region in memory is managed by dividing it into units of pages, that is, into size (region size) units of specified consecutive memory regions. The size of a page managed by the OS may be 4 Kbytes or 8 Kbytes. Recently, depending on the type of OS or process or task operated under control of the OS, a page of which size is larger than a normal size of 4 Kbytes or 8 Kbytes, for example a page in units of Mbytes, has been used. In the following explanation, a page of a normal size such as 4 Kbytes or 8 Kbytes is referred to as a normal page for convenience, and a page of which size is larger than the normal size is referred to as a large page for convenience. When a memory region in memory is managed using a large page, the number of pages requested for using memory of the same size is smaller than in the case where a normal page is used, thereby reducing the page management costs. Therefore, when a large page is used in managing the memory region within the memory, an occurrence of a malfunction such as an erroneous Translation Lookaside Buffer (TLB, address conversion buffer) may be reduced, and the performance of the application may be improved.
However, when a large page of a single size is used in managing the memory region in memory, the effectively available amount of memory may be decreased. For example, if a program of 64 Kbytes is executed in the case where a memory region within the memory is managed using a large page of 4 Mbytes, then it becomes necessary to allocate a memory region of 4 Mbytes for one page to the execution of the program even though the size of the program is only 64 Kbytes.
Therefore, memory may be more effectively used if pages of different sizes are available in accordance with use. A method for efficiently managing memory blocks of different of sizes may be a buddy system, which is used in a Linux kernel and elsewhere. In the buddy system, a plurality of consecutive pages are combined with pages of larger sizes, and a large page is divided into smaller pages, thereby variably controlling a page size. By the execution of the combination and the division of pages, a memory region of an appropriate region size is allocated in accordance with the executed process or task.
The following page allocation system is known. Relating to the memory managed in a page unit, an unsecure page for which it is necessary to prevent the leakage of data is detected when a page acquisition request is issued from an application, when a page is freed up from the application, or when data is set for a page from the application which has secured a page. Then, only the detected unsecure page is initialized.
In addition, the following memory allocation system is known. A system load monitor mechanism monitors the load state of a computer system, and when it determines that the system load is low, it activates a page zero-clear mechanism. The page zero-clear mechanism retrieves from a free page pool a page to be allocated at the next request, zero clears the contents, and transfers the page to a zero clear page pool. When the page zero-clear mechanism determines that a zero cleared page is requested, it returns to a requester the page retrieved from the zero cleared page pool prepared by the page zero-clear mechanism.
Furthermore, the following microprocessor system is known. A microprocessor specifies the leading address and the size to be initialized in the memory. A DMA controller initializes the memory by transferring the initialization data to all addresses to be initialized in the memory having the leading address and the size specified. When the memory is initialized by the DMA transfer, the bit width of the initialization data output from the initialization data register is expanded in the bit width expansion circuit, and transferred to the memory through a data bus.